<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name = "format-detection" content="telephone = no" />
<title>{$config_sitename}</title>
<meta name="description" content="">
<meta name="keywords" content="">
<link href="__CSS__/common.css?t={$ver}" rel="stylesheet">
<link href="__CSS__/sspsh.css?t={$ver}" rel="stylesheet">
<link href="__CSS__/yf.css?t={$ver}" rel="stylesheet">

</head>
<body class="body-pad cl-b-lgrey">
	<div class="loading-wrapper">
		<div class="loading"></div>
	</div>
	<div class="ub ub-ac page-header">
		<a href="javascript:history.back();" class="clickable"><span class="icon-back"></span></a>
		<div class="ub-f1 page-name">随手拍</div>
		<a href="{:U('Index/index')}" class="clickable "><span class="ub-pc icon-back-home"></span></a>
	</div>
	
    	<div class="row ssp-detail-wrapper cl-b-white">
    		<div class="ssp-detail-user ub">
    			<img src="{$data.uavatar}" class="lazy tx-cir ava-js" data-url="{:U('Ucenter/index')}?id={$data.userid}">
    			<div>
    				<p class="cl-f-dgrey f14 ssp-detail-username l20">{$data.nickname}</p>
    				<p class="cl-f-lorange f12 l18">发布于：{$data.create_time|format_time}</p>
    			</div>
    		</div>
    		<div class="ssp-detail-intro f12 cl-f-grey">
    			<p>{$data.content}</p>
    		</div>
    		<div class="spp-detail-img" data-pic="{$data.pic}">
    		<foreach name="data.thumb" item="pic">
    			<img data-original="__WEBURL__{$pic.thumb}" data-pic="{$pic.pic}" class="lazy yf-pic-show">
    		</foreach>
    		</div>
    		<div class="ub ub-ver ssp-detail-like dig-js" data-status="{$dig}">
			    <if condition="$dig eq 1">
    				<img src="__IMAGES__/icon-zan.png" class="ssp-blike">
    				<p class="f12 cl-f-lorange">{$data.goodnum}</p>
				<else/>
				    <img src="__IMAGES__/sp-ic2.png" class="ssp-blike">
				    <p class="f12 cl-f-lorange" style="color: #333;">{$data.goodnum}</p>
				</if>
			</div>
    		<div class="ssp-deail-upload ub ub-pc">
    			<a href="__WEBURL__{:U('suipai/add')}" class="cl-b-lorange upload-btn ub ub-pc ub-ac">
    				<img src="__IMAGES__/icon-cam3.png"><p class="cl-f-white f12">上传随手拍</p>
    			</a>
    		</div>
    	</div>
    	
    	<ul id="thelist" class="comment-list-wrapper cl-b-white">
    		<li class="comment-list-title ub ub-pj row">
    			<p class="f16">大家一起交流(<span class="comment-count">{$data.msgnum|getNullNum}</span>)</p>
    			<p class="f14 comment-js" data-url="/weixin/index/msgList?type={$type}&id={$data.id}">查看所有评论</p>
    		</li>
    		<foreach name="msglist" item="ml">
    		<li class="ub comment-h1 clickable row" id="msg_{$ml.id}">
    			<img src="{$ml.uavatar}" class="tx-cir lazy ava-js" data-url="{:U('Ucenter/index')}?id={$ml.userid}">
    			<div class="comment-text ub-f1">
    				<p class="cl-f-lorange comment-user" data-user="{$ml.nickname}" data-id="{$ml.id}" data-uid="{$ml.userid}">{$ml.nickname}</p>
    				<p class="cl-f-lgrey comment-time">{$ml.create_time|format_time}</p>
    				<div class="cl-f-grey comment-content">
    					<p>{$ml.content}</p>
        				<foreach name="ml.childlist" item="cl">
        					<div class="comment-h2 clickable" id="msg_{$cl.id}">
        						<span class="cl-f-lorange comment-user" data-user="{$cl.nickname}" data-id="{$cl.id}" data-uid="{$cl.userid}">@{$cl.touser.nickname}</span>{$cl.content}
        					</div>
        				</foreach>
    				</div>
    			</div>
    		</li>
    		</foreach>
    	</ul>
	
	<div class="row cl-b-white send-comment-footer">
		<input type="text" name="content" class="form-control  cl-b-xxlgrey" placeholder="我要写评论"  >
		<input type="hidden" name="infoid" value="{$data.id}">
		<input type="hidden" name="type" value="4">
		<input type="hidden" name="parent_id" value="0">
		<input type="hidden" name="touserid" value="0">
		<input type="hidden" name="med" value="comment">
		<a class="cl-f-lorange send-comment-submit" data-type="yes">发送</a>
	</div>
	<script>
    var img_url = "__IMAGES__";
	</script>
	<script src="__JS__/jquery-1.11.1.min.js?t={$ver}"></script>
	<script src="__JS__/jquery.lazyload.min.js?t={$ver}"></script>
    <script src="__JS__/custom.js?t={$ver}"></script>
    <script src="__JS__/comment.js?t={$ver}"></script>
    <script src="__JS__/common.js?t={$ver}"></script>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script>
		var shareTitle = "{$share.shareTitle}";
		var shareDesc = "{$share.shareDesc}";
		var shareUrl = "{$share.shareUrl}";
		var shareImg = "{$share.sharePic}";
		var jsdk = {$jsdk};
		$(function(){
			var userid = "{$userid}";
			$('.dig-js').click(function(e){
	            e.preventDefault();
	            if(userid == undefined || userid == 0 || userid == '')
	            {
	                showToast('请先登录');
	                setTimeout(function(){
	                    location.href = "{:U('Login/index')}";
	                }, 1000);
	                return false;
	            }
	            var _this = $(this);
	            var status = _this.attr('data-status');
	            if(status == 1)
	            {
		            showToast('你已经为该随拍点赞了');
		            return false;
	            }
	            $.ajax({
	                url: '/weixin/suipai/praise',
	                type: 'GET',
	                dataType: 'json',
	                data: {
	                    digtype: 1,
	                    infoid: "{$data.id}"
	                },
	                success: function(res){
	                    if(res.status == 1)
	                    {
	                    	var num = $('.dig-js .cl-f-lorange').text();
	                        $('.dig-js').find('img').attr('src', '__IMAGES__/icon-zan.png');
                        	$('.dig-js').find('p').css('color', '#ff6633');
                            $('.dig-js').attr('data-status', 1);
                            $('.dig-js .cl-f-lorange').text(parseInt(num) + 1);
	                    }
	                    else
	                    {
	                        showToast(res.info);
	                        setTimeout(function(){
		                        if(res.url)
		                        {
		                        	   location.href = res.url;
		                        }
	                        }, 1000);
	                    }
	                },
	                error: function(res){
	                    showToast('系统繁忙');
	                }
	            });
	        });

			$('.ava-js').click(function(e){
	            e.preventDefault();
	            e.stopPropagation();
	            var url = $(this).attr('data-url');
	            location.href = url;
	        });
		});
	</script>
    <script src="__JS__/wx.js?t={$ver}"></script>
</body>
</html>
